<#function isSelected nIdField default_values_list>
	<#if default_values_list?has_content>
		<#list default_values_list as default_value>
			<#if default_value.attributeField?exists && default_value.attributeField.idField = nIdField && default_value.value != "">  		
  				<#return true>
  			</#if>
  		</#list>
	</#if>
	<#return false>
</#function>
<#function hasElement default_values_list>
	<#if default_values_list?has_content>
		<#list default_values_list as default_value>
			<#if default_value.idUserField != 0>
				<#return true>
			</#if>
		</#list>
	</#if>
	<#return false>
</#function>
<div class="control-group">
	<label class="control-label" for="attribute_${attribute.idAttribute}">
		${attribute.title}
	<#if attribute.mandatory>
		*
	</#if>
		: 
	</label>
	<div class="controls">
	<#if !attribute.mandatory>
		<input type="radio" name="attribute_${attribute.idAttribute}" value="" 
			<#if default_values_list?has_content && !hasElement( default_values_list )>
				checked="checked"
			</#if>
		/> #i18n{portal.users.attribute.labelNone}
		<#if !attribute.fieldInLine>
			</div>
		</#if>
	<#else>
		<#if !attribute.fieldInLine>
			</div>
		</#if>
	</#if>
	<#list attribute.listAttributeFields as attributeField>
		<#if attributeField.title?exists && attributeField.value != "">
		
			<#if !attribute.fieldInLine >
				<div class="controls">
			</#if>
			<input type="radio" name="attribute_${attribute.idAttribute}" value="${attributeField.idField}" 
				<#if attributeField.defaultValue >
					checked="checked"
				</#if>
			/> ${attributeField.title}
			<#if !attribute.fieldInLine>
				</div>
			</#if>
		</#if>
	</#list>
	<#if attribute.helpMessage?exists&&attribute.helpMessage!=''>
		<span class="help-block">${attribute.helpMessage}</span>
	</#if>
	<#if attribute.fieldInLine>
		</div>
	</#if>
</div>
